package StructuralPattern.FlyWeight;

/**
 * @Classname : UnsharedConcreteFlyWeight
 * @Description : 非共享的享元角色
 * @Author : chentianyu
 * @Date 2023/2/23 21:25
 */


public class UnsharedConcreteFlyWeight extends FlyWeight {
    // 非共享的享元角色中拥有全部状态
    private int x;
    private int y;

    public UnsharedConcreteFlyWeight(String color) {
        super(color);
    }

    public UnsharedConcreteFlyWeight(String color, int x, int y) {
        super(color);
        this.x = x;
        this.y = y;
    }

    @Override
    public void operate(int x, int y) {

    }

    public void operate() {
        System.out.printf("%s棋子落子位置 (%d, %d)%n", super.getColor(), x, y);
    }
}
